package com.tencreat.mapper.mall;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tencreat.common.enums.BalanceBusinessType;
import com.tencreat.common.enums.BalanceTypeEnum;
import com.tencreat.domain.mall.GoodsRollOrder;
import com.tencreat.domain.mall.RechargeOrder;
import com.tencreat.domain.mall.RechargePackage;
import com.tencreat.domain.mall.vo.BalanceChangeVO;
import com.tencreat.domain.mall.vo.ResBalanceRecordVO;
import com.tencreat.domain.mall.dto.BalanceRecordDTO;
import org.apache.ibatis.annotations.Param;

/**
 * 充值(提现)订单Mapper接口
 *
 * @author wangkai
 * @date 2021-11-13
 */
public interface RechargeOrderMapper extends BaseMapper<RechargeOrder> {

    Page<ResBalanceRecordVO> balanceRecordPage(IPage<ResBalanceRecordVO> page, @Param("params") BalanceRecordDTO params);

    List<BalanceChangeVO> selectPurseDetail(Long uuid);

    BigDecimal queryAmountSub(Integer balanceType);

    BigDecimal queryTotalAdd(Integer balanceType);
    BigDecimal queryAmountSurplus(Integer balanceType);

    BigDecimal queryAmountSurplusV2(@Param("balanceType") Integer balanceType,@Param("userId") Long userId);

    BigDecimal queryTotalOrder(@Param("balanceType") Integer balanceType,@Param("businessType") BalanceBusinessType businessType,@Param("userId") Long userId);

    /**
     * 描述信息  查找充值套餐
     * @Author yaoruiqi
     * @Date: 2023/10/24 03:42
     */
    RechargePackage selectrRechargePackage(@Param("tradeAmount")BigDecimal tradeAmount);

    List<RechargePackage> getRechargePackageList();

    IPage<GoodsRollOrder> goodsRollRecordPage(Page<GoodsRollOrder> page, @Param("params")BalanceRecordDTO params);

    BigDecimal rechargeAmount();
}
